#ifndef __KEY_H
#define __KEY_H

#include "sys1.h"
#include "delay.h"

#define     GPIO_KEY1       GPIOA
#define     PIN_KEY1        GPIO_PIN_0
#define     RCC_KEY1_INIT() __HAL_RCC_GPIOA_CLK_ENABLE()

#define     GPIO_KEY2       GPIOA
#define     PIN_KEY2        GPIO_PIN_1
#define     RCC_KEY2_INIT() __HAL_RCC_GPIOA_CLK_ENABLE()

#define     KEY1            HAL_GPIO_ReadPin(GPIO_KEY1, PIN_KEY1)
#define     KEY2            HAL_GPIO_ReadPin(GPIO_KEY2, PIN_KEY2)

#define     KEY1_PRESS      1
#define     KEY2_PRESS      2

void key_init(void);
uint8_t key_scan(uint8_t mode);


#endif

